import dayjs from 'dayjs'

export default function getDate(timestamp, format = 'YYYY-MM-DD HH:mm:ss') {
  if (isNaN(timestamp)) return
  // 转换为毫秒
  const date = dayjs(timestamp)
  // 格式化日期
  const formattedDate = date.format(format)
  return formattedDate
}
